Move these specs to the right splace.

Akinori MUSHA 10 years ago
parent
commit
4a06afafde
1 changed files with 16 additions and 14 deletions
  1. 16 14
      spec/models/agent_spec.rb

+ 16 - 14
spec/models/agent_spec.rb

@@ -757,6 +757,22 @@ describe Agent do
757 757
       end
758 758
     end
759 759
   end
760
+
761
+  describe '.last_checked_event_id' do
762
+    it "should be updated by setting drop_pending_events to true" do
763
+      agent = agents(:bob_rain_notifier_agent)
764
+      agent.last_checked_event_id = nil
765
+      agent.save!
766
+      agent.update!(drop_pending_events: true)
767
+      agent.reload.last_checked_event_id.should == Event.maximum(:id)
768
+    end
769
+
770
+    it "should not affect a virtual attribute drop_pending_events" do
771
+      agent = agents(:bob_rain_notifier_agent)
772
+      agent.update!(drop_pending_events: true)
773
+      agent.reload.drop_pending_events.should == false
774
+    end
775
+  end
760 776
 end
761 777
 
762 778
 describe AgentDrop do
@@ -852,18 +868,4 @@ describe AgentDrop do
852 868
     interpolate(t, @wsa2).should eq('1: Formatter')
853 869
     interpolate(t, @efa).should eq('0: ')
854 870
   end
855
-
856
-  describe 'last_checked_event_id' do
857
-    it "should be updated by setting drop_pending_events to true" do
858
-      @wsa1.last_checked_event_id = nil
859
-      @wsa1.save!
860
-      @wsa1.update!(drop_pending_events: true)
861
-      @wsa1.reload.last_checked_event_id.should == Event.maximum(:id)
862
-    end
863
-
864
-    it "should not affect a virtual attribute drop_pending_events" do
865
-      @wsa1.update!(drop_pending_events: true)
866
-      @wsa1.reload.drop_pending_events.should == false
867
-    end
868
-  end
869 871
 end